﻿<phone:PhoneApplicationPage 
    x:Class="ThessalonikiGuide.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:eim="clr-namespace:Microsoft.Expression.Interactivity.Media;assembly=Microsoft.Expression.Interactions" 
    xmlns:i ="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:local="clr-namespace:ThessalonikiGuide"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">
	<phone:PhoneApplicationPage.Resources>
        <Storyboard x:Name="mainPageImageStoryboard" AutoReverse="True" RepeatBehavior="Forever">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:50" Value="-1082.109"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Style x:Key="HubTileStyle0" TargetType="toolkit:HubTile">
			<Setter Property="Height" Value="173"/>
			<Setter Property="Width" Value="173"/>
			<Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>
			<Setter Property="Foreground" Value="#FFFFFFFF"/>
            <Setter Property="local:Utils.Tilt" Value="6"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="toolkit:HubTile">
						<StackPanel x:Name="Viewport" Height="173" Width="173">
							<StackPanel.Resources>
								<CubicEase x:Key="HubTileEaseOut" EasingMode="EaseOut"/>
							</StackPanel.Resources>
							<StackPanel.Projection>
								<PlaneProjection x:Name="ViewportProjection" CenterOfRotationY="0.25"/>
							</StackPanel.Projection>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="ImageStates">
									<VisualStateGroup.Transitions>
										<VisualTransition x:Name="ExpandedToSemiexpanded" From="Expanded" GeneratedDuration="0:0:0.85" To="Semiexpanded">
											<Storyboard>
												<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="TitlePanel">
													<EasingDoubleKeyFrame EasingFunction="{StaticResource HubTileEaseOut}" KeyTime="0:0:0.0" Value="-173.0"/>
													<EasingDoubleKeyFrame EasingFunction="{StaticResource HubTileEaseOut}" KeyTime="0:0:0.85" Value="-79.0"/>
												</DoubleAnimationUsingKeyFrames>
												<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="RotationX" Storyboard.TargetName="ViewportProjection">
													<EasingDoubleKeyFrame EasingFunction="{StaticResource HubTileEaseOut}" KeyTime="0:0:0.0" Value="0.0"/>
												</DoubleAnimationUsingKeyFrames>
											</Storyboard>
										</VisualTransition>
										<VisualTransition x:Name="SemiexpandedToCollapsed" From="Semiexpanded" GeneratedDuration="0:0:0.85" To="Collapsed">
											<Storyboard>
												<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="TitlePanel">
													<EasingDoubleKeyFrame EasingFunction="{StaticResource HubTileEaseOut}" KeyTime="0:0:0.0" Value="-79.0"/>
													<EasingDoubleKeyFrame EasingFunction="{StaticResource HubTileEaseOut}" KeyTime="0:0:0.85" Value="0.0"/>
												</DoubleAnimationUsingKeyFrames>
											</Storyboard>
										</VisualTransition>
										<VisualTransition x:Name="CollapsedToExpanded" From="Collapsed" GeneratedDuration="0:0:0.85" To="Expanded">
											<Storyboard>
												<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="TitlePanel">
													<EasingDoubleKeyFrame EasingFunction="{StaticResource HubTileEaseOut}" KeyTime="0:0:0.0" Value="0.0"/>
													<EasingDoubleKeyFrame EasingFunction="{StaticResource HubTileEaseOut}" KeyTime="0:0:0.85" Value="-173.0"/>
												</DoubleAnimationUsingKeyFrames>
											</Storyboard>
										</VisualTransition>
										<VisualTransition x:Name="ExpandedToFlipped" From="Expanded" GeneratedDuration="0:0:0.85" To="Flipped">
											<Storyboard>
												<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="TitlePanel">
													<EasingDoubleKeyFrame EasingFunction="{StaticResource HubTileEaseOut}" KeyTime="0:0:0.0" Value="-173.0"/>
												</DoubleAnimationUsingKeyFrames>
												<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Image">
													<DiscreteObjectKeyFrame KeyTime="0:0:0.185" Value="Collapsed"/>
												</ObjectAnimationUsingKeyFrames>
												<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="RotationX" Storyboard.TargetName="ViewportProjection">
													<EasingDoubleKeyFrame EasingFunction="{StaticResource HubTileEaseOut}" KeyTime="0:0:0.0" Value="0.0"/>
													<EasingDoubleKeyFrame EasingFunction="{StaticResource HubTileEaseOut}" KeyTime="0:0:0.85" Value="180.0"/>
												</DoubleAnimationUsingKeyFrames>
											</Storyboard>
										</VisualTransition>
										<VisualTransition x:Name="FlippedToExpanded" From="Flipped" GeneratedDuration="0:0:0.85" To="Expanded">
											<Storyboard>
												<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="TitlePanel">
													<EasingDoubleKeyFrame EasingFunction="{StaticResource HubTileEaseOut}" KeyTime="0:0:0.0" Value="-173.0"/>
												</DoubleAnimationUsingKeyFrames>
												<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Image">
													<DiscreteObjectKeyFrame KeyTime="0:0:0.185" Value="Visible"/>
												</ObjectAnimationUsingKeyFrames>
												<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="RotationX" Storyboard.TargetName="ViewportProjection">
													<EasingDoubleKeyFrame EasingFunction="{StaticResource HubTileEaseOut}" KeyTime="0:0:0.0" Value="180.0"/>
													<EasingDoubleKeyFrame EasingFunction="{StaticResource HubTileEaseOut}" KeyTime="0:0:0.85" Value="360.0"/>
												</DoubleAnimationUsingKeyFrames>
											</Storyboard>
										</VisualTransition>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Expanded">
										<Storyboard>
											<DoubleAnimation Duration="0" To="-173.0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="TitlePanel"/>
											<DoubleAnimation Duration="0" To="0.0" Storyboard.TargetProperty="RotationX" Storyboard.TargetName="ViewportProjection"/>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Image">
												<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Semiexpanded">
										<Storyboard>
											<DoubleAnimation Duration="0" To="-79.0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="TitlePanel"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Collapsed"/>
									<VisualState x:Name="Flipped">
										<Storyboard>
											<DoubleAnimation Duration="0" To="-173.0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="TitlePanel"/>
											<DoubleAnimation Duration="0" To="180.0" Storyboard.TargetProperty="RotationX" Storyboard.TargetName="ViewportProjection"/>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Image">
												<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Collapsed"/>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Grid x:Name="TitlePanel" Height="346" RenderTransformOrigin="0.5,0.5" Width="173">
								<Grid.RowDefinitions>
									<RowDefinition/>
									<RowDefinition/>
								</Grid.RowDefinitions>
								<Grid.RenderTransform>
									<CompositeTransform/>
								</Grid.RenderTransform>
								<Border Background="{TemplateBinding Background}" Grid.Row="0">
									<TextBlock Foreground="{TemplateBinding Foreground}" FontSize="30" FontFamily="{StaticResource PhoneFontFamilyNormal}" LineStackingStrategy="BlockLineHeight" LineHeight="39" Margin="10,0,0,6" TextWrapping="Wrap" Text="{TemplateBinding Title}" VerticalAlignment="Bottom"/>
								</Border>
								<Grid x:Name="BackPanel" Background="{TemplateBinding Background}" Height="173" Grid.Row="1" Width="173">
									<Grid.Projection>
										<PlaneProjection CenterOfRotationY="0.5" RotationX="180"/>
									</Grid.Projection>
									<Grid.RowDefinitions>
										<RowDefinition Height="*"/>
										<RowDefinition Height="Auto"/>
									</Grid.RowDefinitions>
									<TextBlock x:Name="NotificationBlock" Foreground="{TemplateBinding Foreground}" FontSize="{StaticResource PhoneFontSizeLarge}" FontFamily="{StaticResource PhoneFontFamilyNormal}" LineStackingStrategy="BlockLineHeight" LineHeight="32" Margin="8,8,0,6" Grid.Row="0" TextWrapping="Wrap" Text="{TemplateBinding Notification}"/>
									<TextBlock x:Name="MessageBlock" Foreground="{TemplateBinding Foreground}" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" LineStackingStrategy="BlockLineHeight" LineHeight="23.333" Margin="10,10,10,6" Grid.Row="0" TextWrapping="Wrap" Text="{TemplateBinding Message}"/>
									<TextBlock x:Name="BackTitleBlock" Foreground="{TemplateBinding Foreground}" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Margin="10,0,0,6" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Bottom"/>
								</Grid>
								<Image x:Name="Image" Height="173" Grid.Row="1" Source="{TemplateBinding Source}" Stretch="UniformToFill" Width="173"/>
							</Grid>
						</StackPanel>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot">
        <Image x:Name="image" Source="/thessaloniki.jpg" CacheMode="BitmapCache" Stretch="Fill" Margin="-22,-108,-1484,116" RenderTransformOrigin="0.5,0.5" Opacity="0.7">
            <Image.RenderTransform>
                <CompositeTransform/>
            </Image.RenderTransform>
            <i:Interaction.Triggers>
                <i:EventTrigger SourceName="image">
                    <eim:ControlStoryboardAction Storyboard="{StaticResource mainPageImageStoryboard}"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Image>
        <controls:Panorama x:Name="panorama" Title="Θεσσαλονίκη">
            <!--Panorama item one-->
            <controls:PanoramaItem/>
            <controls:PanoramaItem/>
            <controls:PanoramaItem/>
            <controls:PanoramaItem/>
        </controls:Panorama>
    </Grid>

    <!--Panorama-based applications should not show an ApplicationBar-->
</phone:PhoneApplicationPage>